.class public Lcom/zuiapps/suite/utils/device/SilentUtil;
.super Ljava/lang/Object;
.source "SilentUtil.java"


# instance fields
.field private mAudioManager:Landroid/media/AudioManager;

.field private mContext:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .registers 3
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 16
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 17
    iput-object p1, p0, Lcom/zuiapps/suite/utils/device/SilentUtil;->mContext:Landroid/content/Context;

    .line 18
    const-string v0, "audio"

    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/media/AudioManager;

    iput-object v0, p0, Lcom/zuiapps/suite/utils/device/SilentUtil;->mAudioManager:Landroid/media/AudioManager;

    .line 19
    return-void
.end method


# virtual methods
.method public getSilentStatus()I
    .registers 2

    .prologue
    .line 23
    :try_start_0
    iget-object v0, p0, Lcom/zuiapps/suite/utils/device/SilentUtil;->mAudioManager:Landroid/media/AudioManager;

    invoke-virtual {v0}, Landroid/media/AudioManager;->getRingerMode()I
    :try_end_5
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_5} :catch_7

    move-result v0

    .line 26
    :goto_6
    return v0

    .line 24
    :catch_7
    move-exception v0

    .line 26
    const/4 v0, 0x2

    goto :goto_6
.end method

.method public setSilentMode()V
    .registers 3

    .prologue
    .line 30
    invoke-virtual {p0}, Lcom/zuiapps/suite/utils/device/SilentUtil;->getSilentStatus()I

    move-result v0

    packed-switch v0, :pswitch_data_1e

    .line 41
    :goto_7
    return-void

    .line 32
    :pswitch_8
    iget-object v0, p0, Lcom/zuiapps/suite/utils/device/SilentUtil;->mAudioManager:Landroid/media/AudioManager;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->setRingerMode(I)V

    goto :goto_7

    .line 35
    :pswitch_f
    iget-object v0, p0, Lcom/zuiapps/suite/utils/device/SilentUtil;->mAudioManager:Landroid/media/AudioManager;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->setRingerMode(I)V

    goto :goto_7

    .line 38
    :pswitch_16
    iget-object v0, p0, Lcom/zuiapps/suite/utils/device/SilentUtil;->mAudioManager:Landroid/media/AudioManager;

    const/4 v1, 0x2

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->setRingerMode(I)V

    goto :goto_7

    .line 30
    nop

    :pswitch_data_1e
    .packed-switch 0x0
        :pswitch_8
        :pswitch_16
        :pswitch_f
    .end packed-switch
.end method

.method public setSilentModeForMiuiV6()V
    .registers 3

    .prologue
    const/4 v1, 0x2

    .line 44
    invoke-virtual {p0}, Lcom/zuiapps/suite/utils/device/SilentUtil;->getSilentStatus()I

    move-result v0

    packed-switch v0, :pswitch_data_1c

    .line 55
    :goto_8
    return-void

    .line 46
    :pswitch_9
    iget-object v0, p0, Lcom/zuiapps/suite/utils/device/SilentUtil;->mAudioManager:Landroid/media/AudioManager;

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->setRingerMode(I)V

    goto :goto_8

    .line 49
    :pswitch_f
    iget-object v0, p0, Lcom/zuiapps/suite/utils/device/SilentUtil;->mAudioManager:Landroid/media/AudioManager;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->setRingerMode(I)V

    goto :goto_8

    .line 52
    :pswitch_16
    iget-object v0, p0, Lcom/zuiapps/suite/utils/device/SilentUtil;->mAudioManager:Landroid/media/AudioManager;

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->setRingerMode(I)V

    goto :goto_8

    .line 44
    :pswitch_data_1c
    .packed-switch 0x0
        :pswitch_9
        :pswitch_16
        :pswitch_f
    .end packed-switch
.end method

.method public setSilentModeForV21()V
    .registers 3

    .prologue
    const/4 v1, 0x2

    .line 58
    invoke-virtual {p0}, Lcom/zuiapps/suite/utils/device/SilentUtil;->getSilentStatus()I

    move-result v0

    packed-switch v0, :pswitch_data_1c

    .line 69
    :goto_8
    return-void

    .line 60
    :pswitch_9
    iget-object v0, p0, Lcom/zuiapps/suite/utils/device/SilentUtil;->mAudioManager:Landroid/media/AudioManager;

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->setRingerMode(I)V

    goto :goto_8

    .line 63
    :pswitch_f
    iget-object v0, p0, Lcom/zuiapps/suite/utils/device/SilentUtil;->mAudioManager:Landroid/media/AudioManager;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->setRingerMode(I)V

    goto :goto_8

    .line 66
    :pswitch_16
    iget-object v0, p0, Lcom/zuiapps/suite/utils/device/SilentUtil;->mAudioManager:Landroid/media/AudioManager;

    invoke-virtual {v0, v1}, Landroid/media/AudioManager;->setRingerMode(I)V

    goto :goto_8

    .line 58
    :pswitch_data_1c
    .packed-switch 0x0
        :pswitch_9
        :pswitch_16
        :pswitch_f
    .end packed-switch
.end method
